export function formatDateTime(template = 'yyyy-MM-dd HH:mm:ss') {
  const date = new Date() // 设置要格式化的日期
  return template
    .replace(/yyyy/g, date.getFullYear())
    .replace(/MM/g, (date.getMonth() + 1).toString().padStart(2, '0'))
    .replace(/dd/g, date.getDate().toString().padStart(2, '0'))
    .replace(/HH/g, date.getHours().toString().padStart(2, '0'))
    .replace(/mm/g, date.getMinutes().toString().padStart(2, '0'))
    .replace(/ss/g, date.getSeconds().toString().padStart(2, '0'))
}
